import BaseObject from "../base/BaseObject";

export default class Event extends BaseObject {

    constructor() {
        super();
        this.type = '';
        this.data = null;
        this.target = null;
        this.currentTarget = null;
    }

    _onClear() {
        this.type = '';
        this.data = null;
        this.target = null;
        this.currentTarget = null;
    }

    toString() {
        return '[object Event Type ' + this.type + ' Data ' + this.data + ']';
    }

    copyFrom(value) {
        this.type = value.type;
        this.data = value.data;
        this.target = value.target;
        return this;
    }

    dispose() {
        this._onClear();
    }

}

Event.RESIZE = 'resize';
Event.COMPLETE = 'complete';
Event.IO_ERROR = 'ioError';